<?php
session_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Admin</title>
<link href="loginmodule.css" rel="stylesheet" type="text/css" />
</head>
<body>

<?php
include_once ("common.php");
printHeader();
?>

<h1>Welcome <?php echo $_SESSION['SESS_FIRST_NAME'];?></h1>

<form name=form method=post action="search-feedback.php" >
<table align="right">
<tr>
    <td><input type=text name=moviefeedback size="12"><input type=submit value="search movie"></td>
</tr> 
</table>
</form>
</body>
</html>
<?php
require_once ('config.php');

$con = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);

if (!$con) {
	die('Could not connect: ' . mysql_error());
}

mysql_select_db(DB_DATABASE, $con);

$sqlresult = mysql_query(" select m.*, s.showtime, s.available_tickets from movielist m, showtimes s where m.ID=s.movieID");

echo "<br><br><br><br><br><br><br><br><table border='1' align=\"center\">
<tr>
<th>Movie ID</th>
<th>Movie Name</th>
<th>Movie Rating</th>
<th>Picture Path</th>
<th>Showtime</th>
<th>Available Tickets</th>
</tr>";
while ($row = mysql_fetch_array($sqlresult)) {
	//echo $row['movieid'] . " " . $row['moviename'] . " " .$row['movierating']."   ".$row['city'] . " " . $row['totaltickets'];
	echo "<tr>";
	echo "<td>" . $row['ID'] . "</td>";
	echo "<td>" . $row['name'] . "</td>";
	echo "<td>" . $row['rating'] . "</td>";
	echo "<td>" . $row['picture_path'] . "</td>";
	echo "<td>" . $row['showtime'] . "</td>";
	echo "<td>" . $row['available_tickets'] . "</td>";
	echo "</tr>";
}
echo "</table>";

mysql_close($con)
?>
</body>
</html>
